package com.huawei.appgallery.wishwall.ui.activity;

import android.os.Bundle;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.protocol.BaseListFragmentRequest;
import com.huawei.appgallery.foundation.ui.framework.uikit.ContractFragment;
import com.huawei.appgallery.wishbase.ui.activity.WishBaseActivity;
import com.huawei.appgallery.wishwall.api.IWishWallReplyActivityProtocol;
import com.huawei.appgallery.wishwall.api.IWishWallReplyActivityResult;
import com.huawei.appgallery.wishwall.api.IWishWallReplyFragmentProtocol;
import com.huawei.appgallery.wishwall.api.IWishWallReplyFragmentProtocol.Request;
import com.huawei.appgallery.wishwall.ui.fragment.WishWallReplyFragment.c;
import com.huawei.hmf.annotation.ActivityDefine;
import o.cjk;
import o.cjm;
import o.cjo;
import o.ddq;
import o.ddq.d;
import o.ddq.f;
import o.fjf;

@ActivityDefine(alias = "wish.wall.reply.activity", protocol = IWishWallReplyActivityProtocol.class, result = IWishWallReplyActivityResult.class)
public class WishWallReplyActivity extends WishBaseActivity<IWishWallReplyActivityProtocol> implements c {
    private boolean ˊॱ;
    private IWishWallReplyActivityProtocol ˏॱ;
    private String ͺ;
    private String ॱˊ;

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(ddq.c.ˎ);
        ॱ(getString(f.ˎˎ), d.ˏˏ);
        this.ˏॱ = (IWishWallReplyActivityProtocol) ʾ();
        if (this.ˏॱ != null) {
            if (this.ˏॱ.ˎ() != null) {
                this.ॱˊ = this.ˏॱ.ˎ().ॱ();
                this.ͺ = this.ˏॱ.ˎ().ˊ();
            }
            ᐝ();
        }
    }

    private void ᐝ() {
        cjo iWishWallReplyFragmentProtocol = new IWishWallReplyFragmentProtocol();
        BaseListFragmentRequest request = new Request();
        request.ॱˊ(this.ॱˊ);
        request.ˋॱ(this.ͺ);
        iWishWallReplyFragmentProtocol.ˏ(request);
        ContractFragment contractFragment = (ContractFragment) cjk.ˎ().ˊ(new cjm(this.ˏॱ.ˋ(), iWishWallReplyFragmentProtocol));
        if (contractFragment instanceof TaskFragment) {
            ((TaskFragment) contractFragment).ˋ(ˏॱ(), d.ͺ, "FRAGMENT_TAG");
        }
    }

    public void finish() {
        fjf ˊ = fjf.ˊ(this);
        ((IWishWallReplyActivityResult) ˊ.ॱ()).setHasReplied(this.ˊॱ);
        setResult(-1, ˊ.ˊ());
        super.finish();
    }

    public void ˎ(boolean z) {
        this.ˊॱ = z;
    }
}
